home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 February / Gamestar_81_2006-02_dvd.iso / Red Shark / Missions / Mission_15 / MissionTasks.script < prev    next >
Text File  |  2001-11-12  |  6KB  |  232 lines

  1. //-------------------------------------------------------------------
  2. //
  3. //  This code is copyright 2001 by G5 Software.
  4. //  Any unauthorized usage, either in part or in whole of this code
  5. //  is strictly prohibited. Violators WILL be prosecuted to the
  6. //  maximum extent allowed by law.
  7. //
  8. //-------------------------------------------------------------------
  9.  
  10. ///////////////////////////////////
  11. //
  12. // Mission 15 -- Survival
  13. //
  14. ///////////////////////////////////
  15. class CMission15_AIController extends CBaseAIController, CNavPointUser, CSurvivalMission_Strings
  16. {
  17.   array  ActivatePointCenterList = array(
  18.     vector( 6622, 4148, 0 )     //
  19.     );    //
  20.   array  ActivatePointRadiusList = array(
  21.     100.0                       //
  22.     );
  23.   array  ActivatePointNameList = array(
  24.     "A"
  25.     );
  26.  
  27.   int MissionStartTime     = 0;          // Time initialized
  28.  
  29.   final int m_GTobruqStartTime   = 5000;
  30.   final int m_GAqaliaStartTime   = 20000;
  31.   final int m_GBenghaziStartTime = 30000;
  32.   final int m_BwairatStartTime   = 105000;
  33.  
  34.   boolean GTobruqStarted   = false;
  35.   boolean GAqaliaStarted   = false;
  36.   boolean GBenghaziStarted = false;
  37.   boolean BwairatStarted   = false;
  38.  
  39.   void Init( int _Time )
  40.   {
  41.     MissionStartTime = _Time;
  42.   }
  43.   void Update( int _Time )
  44.   {
  45.     if ( (_Time>= (MissionStartTime + m_GTobruqStartTime)) && ( !GTobruqStarted ) )
  46.      {
  47.        GTobruqStarted = true;
  48.        Core_SendEventTo( "Helicopter",
  49.           "OnDisplayMessage",
  50.           str_TobruqPatrol,
  51.           color(1.0, 0.0, 0.0));
  52.        Core_BroadcastEvent("GTobruqStarted");
  53.      }
  54.     if ( (_Time>= (MissionStartTime + m_GAqaliaStartTime)) && ( !GAqaliaStarted ) )
  55.      {
  56.        GAqaliaStarted = true;
  57.        Core_SendEventTo( "Helicopter",
  58.           "OnDisplayMessage",
  59.           str_AqaliaPatrol,
  60.           color(1.0, 0.0, 0.0));
  61.        Core_BroadcastEvent("GAqaliaStarted");
  62.      }
  63.     if ( (_Time>= (MissionStartTime + m_GBenghaziStartTime)) && ( !GBenghaziStarted ) )
  64.      {
  65.        GBenghaziStarted = true;
  66.        Core_SendEventTo( "Helicopter",
  67.           "OnDisplayMessage",
  68.           str_BenghaziPatrol,
  69.           color(1.0, 0.0, 0.0));
  70.        Core_BroadcastEvent("GBenghaziStarted");
  71.      }
  72.     if ( (_Time>= (MissionStartTime + m_BwairatStartTime)) && ( !BwairatStarted ) )
  73.      {
  74.        BwairatStarted = true;
  75.        Core_BroadcastEvent("BwairatStarted");
  76.      }
  77.  
  78.   }
  79.  
  80.   boolean m_ConvoyGetNavPoint   = false;
  81.   boolean m_BwairatGetNavPoint  = false;
  82.  
  83.   void OnObjectEnterArea( int _AreaIndex, string _NavPointName, string _ObjectID)
  84.   {
  85.     if ( Core_IsStringStartsWith( _NavPointName, "NavPoint_02") && Core_IsStringStartsWith( _ObjectID, "15_G") && !m_ConvoyGetNavPoint )
  86.     {
  87.       m_ConvoyGetNavPoint = true;
  88.        Core_SendEventTo( "Helicopter",
  89.           "OnDisplayMessage",
  90.           str_GermanConvoyRichThePoint,
  91.           color(1.0, 0.0, 0.0));
  92.       Core_BroadcastEvent("ConvoyGetNavPoint_02");
  93.     }
  94.     if ( Core_IsStringStartsWith( _NavPointName, "NavPoint_03") && Core_IsStringStartsWith( _ObjectID, "15_Bwairat") && !m_BwairatGetNavPoint )
  95.     {
  96.       m_BwairatGetNavPoint = true;
  97.       Core_BroadcastEvent("BwairatStopped");
  98.     }
  99.  
  100.   }
  101. }
  102. //================================================================================
  103. class C15_GTobruq extends CNavPointUser, CBaseAITask_Patrol
  104. {
  105.   array GetPatrolTrip()
  106.     {
  107.       return array (GetNavPoint("NavPoint_01"),
  108.                     GetNavPoint("NavPoint_02"),
  109.                     GetNavPoint("NavPoint_03"));
  110.     }
  111.   float GetTripSpeed()
  112.     {
  113.       return 25;
  114.     }
  115.   void Init()
  116.     {
  117.        DeactivatePatrol();
  118.     }
  119.   void GTobruqStarted()
  120.     {
  121.       ActivatePatrol();
  122.     }
  123.   void OnEnemyOnRadar()
  124.     {
  125.     }
  126.   void Wave1MemberStopped( string _idConvoy )
  127.     {
  128.       if ( _idConvoy == "Tobruq")
  129.        {
  130.          DeactivatePatrol();
  131.        }
  132.     }
  133.  
  134. }
  135. //----------------------------------------------------------------------------
  136. class C15_GAqalia extends C15_GTobruq
  137. {
  138.   float GetTripSpeed()
  139.     {
  140.       return 28;
  141.     }
  142.   void GTobruqStarted()
  143.     {
  144.     }
  145.   void GAqaliaStarted()
  146.     {
  147.       ActivatePatrol();
  148.     }
  149.   void Wave1MemberStopped( string _idConvoy )
  150.     {
  151.       if ( _idConvoy == "Aqalia")
  152.        {
  153.          DeactivatePatrol();
  154.        }
  155.     }
  156. }
  157. //---------------------------------------------------------------------------
  158. class C15_GBenghazi extends C15_GTobruq
  159. {
  160.   float GetTripSpeed()
  161.     {
  162.       return 25;
  163.     }
  164.   void GTobruqStarted()
  165.     {
  166.     }
  167.   void GBenghaziStarted()
  168.     {
  169.       ActivatePatrol();
  170.     }
  171.   void Wave1MemberStopped( string _idConvoy )
  172.     {
  173.       if ( _idConvoy == "Benghazi")
  174.        {
  175.          DeactivatePatrol();
  176.        }
  177.     }
  178. }
  179. //---------------------------------------------------------------------------------
  180. class C15_GBenghaziTank extends C15_GBenghazi
  181. {
  182.   float GetTripSpeed()
  183.     {
  184.       return 25;
  185.     }
  186.   void GTobruqStarted()
  187.     {
  188.     }
  189.   void GBenghaziStarted()
  190.     {
  191.       ActivatePatrol();
  192.     }
  193.   void OnEnemyOnRadar()
  194.     {
  195.     }
  196.   void Wave1MemberStopped( string _idConvoy )
  197.     {
  198.       if ( _idConvoy == "Benghazi")
  199.        {
  200.          DeactivatePatrol();
  201.        }
  202.     }
  203. }
  204. //----------------------------------------------------------------------------------
  205. class C15_Bwairat extends C15_GTobruq
  206. {
  207.   array GetPatrolTrip()
  208.     {
  209.       return array (GetNavPoint("NavPoint_02"),
  210.                     GetNavPoint("NavPoint_03"));
  211.     }
  212.   float GetTripSpeed()
  213.     {
  214.       return 25;
  215.     }
  216.   void GTobruqStarted()
  217.     {
  218.     }
  219.   void BwairatStarted()
  220.     {
  221.       ActivatePatrol();
  222.     }
  223.   void BwairatStopped( )
  224.     {
  225.       DeactivatePatrol();
  226.     }
  227.   void Wave1MemberStopped( string _idConvoy )
  228.     {
  229.     }
  230. }
  231.  
  232.